#define RCC_APB2ENR (*((volatile unsigned int *)0x40021018))
#define GPIOC_CRL   (*((volatile unsigned int *)0x40011000))
#define GPIOC_ODR   (*((volatile unsigned int *)0x4001100c))

void USART1_Init(void);

/*延时函数*/
static void delay(unsigned int num){
	if(num > 0){
		while(num--){
			
		}
	}
}

void test_led(void){
	unsigned int a = 1500000;
	/*使能GPIO端口C的时钟*/
	RCC_APB2ENR |= 0x00000010;
	/*配置GPIO端口C，推挽输出，频率50MHz*/
	GPIOC_CRL = 0x33333333;
	/*熄灭LED*/
	GPIOC_ODR |= 0x000000ff;
	/*初始化串口*/
	USART1_Init();
	while(1){
		delay(a);
		/*点亮LED*/
		GPIOC_ODR &= 0xffffff00;
		delay(a);
		/*熄灭LED*/
		GPIOC_ODR |= 0x000000ff;
	}
	
	return;
}
